# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=orc
pkgver=0.4.40
pkgrel=1
pkgdesc="Oil Run-time Compiler"
url="https://gstreamer.freedesktop.org/modules/orc.html"
arch="all"
license="BSD-2-Clause"
depends_dev="$pkgname-compiler=$pkgver-r$pkgrel"
makedepends="linux-headers meson"
subpackages="$pkgname-dev $pkgname-compiler"
source="https://gstreamer.freedesktop.org/src/orc/orc-$pkgver.tar.xz"

# secfixes:
#   0.4.39-r0:
#     - CVE-2024-40897

build() {
	abuild-meson \
		-Db_lto=true \
		-Dorc-test=disabled \
		-Dbenchmarks=enabled \
		-Dtools=enabled \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

compiler() {
	pkgdesc="Orc compiler"

	amove usr/bin
}

sha512sums="
2cbc0b8b9f5f429e0c4b24b7b9a8bc5d249c013470d8a595fdb3969a68a90c95c3b1e79063851f2d0ca7f7888d33901f227d2e04f919df00caf37eca6270c0e3  orc-0.4.40.tar.xz
"
